#include "main.h"

bool Stack::empty()
{
    return vecStr.empty();
}
bool Stack::push(const string& str)
{
    if (full()) {
        return false;
    }
    vecStr.push_back(str);
    return true;
}
bool Stack::full()
{
    return(vecStr.size() == vecStr.max_size());
}
bool Stack::pop(string& str)
{
    if (empty()) {
        return false;
    }
    str = vecStr.back();
    vecStr.pop_back();
    return true;
}
bool Stack::find(const string& str)
{
    for(auto val : vecStr) {
        if (val == str) {
            return true;
        }
    }
    return false;
}
int Stack::count(const string& str)
{
    int num = 0;
    for(auto val : vecStr) {
        if (val == str) {
            num++;
        }
    }
    return num;
}

Triangular::Triangular()
{
    _length = 1;
    _beg_pos = 9;
    _next = 0;
}
Triangular::Triangular(int len)
{
    _length = len;
    _beg_pos = 9;
    _next = 0;
}
Triangular::Triangular(int len, int beg_pos)
{
    _length = len;
    _beg_pos = beg_pos;
    _next = 0;
    name = "Triangular";
}
Triangular::Triangular(const Triangular& rhs)
    :_length(rhs._length),
    _beg_pos(rhs._beg_pos),
    _next(rhs._next)
{

}

Triangular& Triangular::copy(const Triangular& rhs)
{
    if(this != &rhs) {
        _length = rhs._length;
        _beg_pos = rhs._beg_pos;
        _next = rhs._next;
    }
    return *this;
}

int Triangular::elem(int pos) const
{
    return _elem[pos];
}

int main()
{
    {
        Matrix ma(4, 4);
        {
            Matrix ma2 = ma;
        }
    }
    return 0;
}